<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.cnbisoft.utils.tools.properties.*"%>
<%@ page import="com.cnbisoft.utils.bean.*"%>
<%@ page import="java.io.*"%>
<%   
		String path = request.getContextPath(),
		 basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
        PropertyReader bean = new PropertyReader();
        String filePath = this.getServletContext().getRealPath(File.separator)+"dashboard"+File.separator+"forcecast"+File.separator+"dupont"+File.separator+"index.properties";
        bean.setUrl(filePath);
        System.out.println(filePath);
        List<Map<String,UtilBean>> list =(List)bean.getSysModelMap();
        Map<String,UtilBean> itemMap = (Map<String,UtilBean>)list.get(0);
        Set set = itemMap.keySet();
        Iterator it = set.iterator();
        StringBuffer item = new StringBuffer(),indicator = new StringBuffer(),zIndicator = new StringBuffer("[");
        int a=0;
         while(it.hasNext()) {
    	   String key = (String)it.next();
    	   UtilBean b = (UtilBean)itemMap.get(key);
    	   if(!key.equals("ldzc")&& !key.equals("zzc")&& !key.equals("fzze")&&!key.contains("title")&&!key.contains("zzcNC")){//zzcNC
           // System.out.println("key:" +key+"------value:"+b.getId()+"------"+b.getText());
        	item.append(b.getId());
             if(a!=itemMap.size()-1){
             	item.append(",");
             }
             a++;
    	   }
           
        }
         String index = item.toString()+itemMap.get("ldzc").getId()+","+itemMap.get("fzze").getId()+","+itemMap.get("zzc").getId()+";"+itemMap.get("zzcNC").getId();
        // System.out.println(list.size()+"--------------------------"+filePath);
         Map<String,UtilBean> inMap =(Map<String,UtilBean>)list.get(1);
         Set iset = inMap.keySet();
         Iterator its = iset.iterator();
         a=0;
          while(its.hasNext()) {
          
     	   String key = (String)its.next();
     	   UtilBean b = (UtilBean)inMap.get(key);
     	    indicator.append(b.getId());
	         if(a!=inMap.size()-1){
	        	  indicator.append(",");
	         }
	         a++;
            // System.out.println("key:" +key+"------value:"+b.getId()+"------"+b.getText());
         }
          
         
          Map<String,UtilBean> zdyMap =(Map<String,UtilBean>)list.get(2);
        //  System.out.println(zdyMap.size()+"--"+zdyMap.get("85")+"--------------------------"+filePath);
          Set zMapSet = zdyMap.keySet();
          Iterator zIt = zMapSet.iterator();
          a=0;
          while(zIt.hasNext()){
        	  String key =(String)zIt.next();
        	  UtilBean b = (UtilBean)zdyMap.get(key);
        	  zIndicator.append("{\"id\":\""+key+"\",\"formular\":"+b.getText()+",\"params\":["+b.getId()+"],\"exp\":\""+b.getSql()+"\"}");
        	  if(a!=zdyMap.size()-1){
        		  zIndicator.append(",");
	           }
        	  a++;
        	 // System.out.println("key:" +key+"------value:"+b.getId()+"------"+b.getText());
          }
          zIndicator.append("]");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>最新杜邦分析模型</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<jsp:include page="../../common/jsp/sys.jsp"></jsp:include>
<style type="text/css">
.shell_img{width:850px;height:17px;border:0px solid black;margin:0 auto}
.shell_z{width:850px;height:50px;margin:0 auto}
.top{width:850px;height:400px;margin:0 auto}
.but{width:850px;height:260px;margin:0 auto}
.but_left{width:170px;height:260px;float:left;}
.content{width:85px;height:50px;float:left}
.sliderText{font-size:12px;font-family:"微软雅黑";font-weight:bold;text-align:left;margin-left:-15px}
/* *{margin:0 auto;padding:0px;font-family:"微软雅黑"} */
.document{margin:0 auto;padding:0px;width:850px;height:660px;border:0px solid red}
.text{font-size: 12px;font-family:"微软雅黑";font-weight:bold;text-align: left;width:300px}
.text1{font-size: 12px;font-family:"微软雅黑";font-weight:bold;text-align: center;width:300px;margin-left:-108px;align:center}
.center{border:0px solid black;width:850px;height:260px}
.center-left{width:400px;border:0px solid black;height:260px;float:left}
.center-right{width:450px;border:0px solid black;height:260px;float:left}
input,span{border:0;font-weight:bold;width:120px;-webkit-border-radius: 45px;border-radius: 45px;height:18px;padding-left:10px}
input:focus{background-color: #FF6} 
.x-progress-bar{height:18px !important;}
/* .x-progress-text{heigth:18px;} */
.layerTh th{
  font-family:"微软雅黑";
  font-size:12px;
  text-align:center;
  margin:0 auto;
  padding:0px;
  width:100px;
  -webkit-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 2px 2px 2px 2px rgba(3, 3, 3, .2);
box-shadow: 2px 2px 2px 2px rgba(3, 3, 3, .2);
}
#layer1{
 
  margin:0 auto;
  padding:0px;
}
</style>
</head>  
<body>
 <jsp:include page="../../common/jsp/common.jsp"></jsp:include>
<div id="mainshell" style="height:700px;"  class="image_divss">
 <div class="mainshell"><%=itemMap.get("title").getText()%></div>
 <div class="document" id="doc">
   <div class="top">
    <div class="shell_z">
     <div class="content" style="margin-left:435px">	
	  <div class="text1" ><strong><%=inMap.get("jzcsyv").getText() %></strong></div>
      <div id="<%=inMap.get("jzcsyv").getId() %>Idspan" class="text1"><strong></strong></div>
	  <div id="<%=inMap.get("jzcsyv").getId() %>Id" style="width:85px"></div>
	 </div>
	</div>			
	<div class="shell_img"><img src="images/bg1.png"></div>				
    <div class="shell_z">
	 <div class="content" style="margin-left:380px">
	  <div class="text1"><strong><%=inMap.get("zzcjlv").getText() %></strong></div>
      <div id="<%=inMap.get("zzcjlv").getId() %>Idspan" class="text1"><strong></strong></div>
	  <div id="<%=inMap.get("zzcjlv").getId() %>Id" style="width:85px"></div>
     </div>
     <div class="content" style="margin-left:26px">
	  <div class="text1"><strong><%=inMap.get("qycs").getText() %></strong></div>
      <div id="<%=inMap.get("qycs").getId() %>Idspan" class="text1"><strong></strong></div>
	  <div id="<%=inMap.get("qycs").getId() %>Id" style="width:85px"></div>
     </div>             
    </div>									
	<div class="shell_img"><img src="images/bg2.png"></div>			
	<div class="shell_z">
	 <div class="content" style="margin-left:250px">
	  <div class="text1"><strong><%=inMap.get("xslrv").getText() %></strong></div>
      <div id="<%=inMap.get("xslrv").getId() %>Idspan" class="text1"><strong></strong></div>										
	  <div id="<%=inMap.get("xslrv").getId() %>Id" style="width:85px"></div>
     </div>
	 <div class="content" style="margin-left:165px">
	  <div class="text1"><strong><%=inMap.get("zzczzv").getText() %></strong></div>
      <div id="<%=inMap.get("zzczzv").getId() %>Idspan" class="text1"><strong></strong></div>
	  <div id="<%=inMap.get("zzczzv").getId() %>Id" style="width:85px"></div>
	 </div>		
    </div>			
	<div class="shell_img"><img src="images/bg3.png"></div>	
	<div class="shell_z">
	 <div class="content" style="margin-left:190px">
	  <div class="text1"><strong><%=inMap.get("shjlr").getText() %></strong></div>
      <div id="<%=inMap.get("shjlr").getId() %>Idspan" class="text1"><strong></strong></div>
	  <div id="<%=inMap.get("shjlr").getId() %>Id" style="width:85px"></div>
	 </div>
	 <div class="content" style="margin-left:36px">										
	  <div class="text1"><strong><%=itemMap.get("yysr").getText() %></strong></div>
      <div id="<%=itemMap.get("yysr").getId() %>pro1Idspan" class="text1"></div>
	  <div id="<%=itemMap.get("yysr").getId() %>pro1Id" style="width:110px;margin-top:1px"></div>
	 </div>
	 <div class="content" style="margin-left:45px">										
	  <div class="text1"><strong><%=itemMap.get("yysr").getText() %></strong></div>
      <div id="<%=itemMap.get("yysr").getId() %>pro2Idspan" class="text1">
      <input type="text" id="<%=itemMap.get("yysr").getId() %>pro2Idinput" value="10000" style="text-align: right"></div>										
	  <div id="<%=itemMap.get("yysr").getId() %>pro2Id" style="width:110px;margin-top:1px"></div>								
	 </div>
	 <div class="content" style="margin-left:36px">										
	  <div class="text1"><strong><%=itemMap.get("zzc").getText() %></strong></div>
      <div id="<%=itemMap.get("zzc").getId() %>Idspan" class="text1"><strong></strong></div>								
	  <div id="<%=itemMap.get("zzc").getId() %>Id" style="width:85px"></div>								
	 </div>				
    </div>
	<div class="shell_img"><img src="images/bg4.png"></div>		
	<div class="shell_z">						
	 <div class="content" style="margin-left:79px">										
	  <div class="text1"><strong><%=itemMap.get("yysr").getText() %></strong></div>
      <div id="" class="text1">
      <input type="text" id="<%=itemMap.get("yysr").getId() %>Idinput" value="10000" style="text-align: right"></div>							
	  <div id="<%=itemMap.get("yysr").getId() %>Id" style="width:100px;margin-top:3px"></div>								
	 </div>	
	 <div class="content" style="margin-left:26px">										
	  <div class="text1"><strong><%=inMap.get("cbfyze").getText() %></strong></div>
      <div id="<%=inMap.get("cbfyze").getId() %>Idspan" class="text1"><strong></strong></div>
	  <div id="<%=inMap.get("cbfyze").getId() %>Id" style="width:85px"></div>								
	 </div>							
	 <div class="content" style="margin-left:26px">									
	  <div class="text1"><strong><%=itemMap.get("sds").getText() %></strong></div>
      <div id="<%=itemMap.get("sds").getId() %>Idspan" class="text1">
      <input type="text" id="<%=itemMap.get("sds").getId() %>Idinput" value="10000" style="text-align: right"></div>
	  <div id="<%=itemMap.get("sds").getId() %>Id" style="width:110px;margin-top:3px"></div>							
	 </div>									
	 <div class="content" style="margin-left:120px">										
	  <div class="text1"><strong><%=itemMap.get("fldzc").getText() %></strong></div>
	  <div id="<%=itemMap.get("fldzc").getId() %>proIdspan" class="text1"></div>
	  <div id="<%=itemMap.get("fldzc").getId() %>proId" style="width:100px;margin-top:3px"></div>								
	 </div>
	 <div class="content" style="margin-left:26px">									
	  <div class="text1"><strong><%=itemMap.get("ldzc").getText() %></strong></div>
      <div id="<%=itemMap.get("ldzc").getId() %>Idspan" class="text1"><strong> </strong></div>
	  <div id="<%=itemMap.get("ldzc").getId() %>Id" style="width:85px"></div>								
	 </div>				
    </div>
	<div class="shell_img"><img src="images/bg5.png"></div>				
	<div class="shell_z">			
     <div class="content">										
	  <div class="text1"><strong><%=itemMap.get("yycb").getText() %></strong></div>
	  <div id="<%=itemMap.get("yycb").getId() %>proIdspan" class="text1"><strong>20.7%</strong></div>										
	  <div id="<%=itemMap.get("yycb").getId() %>proId" style="width:85px"></div>								
	 </div>	
	 <div class="content" style="margin-left:9px">										
	  <div class="text1"><strong><%=itemMap.get("xsfy").getText() %></strong></div>
	  <div id="<%=itemMap.get("xsfy").getId() %>proIdspan" class="text1"><strong>20.7%</strong></div>										
	  <div id="<%=itemMap.get("xsfy").getId() %>proId" style="width:85px"></div>								
	 </div>	
	 <div class="content" style="margin-left:9px">										
	  <div class="text1"><strong><%=itemMap.get("glfy").getText() %></strong></div>										
	  <div id="<%=itemMap.get("glfy").getId() %>proIdspan" class="text1"><strong>20.7%</strong></div>										
	  <div id="<%=itemMap.get("glfy").getId() %>proId" style="width:85px"></div>								
	 </div>				
	 <div class="content" style="margin-left:9px">										
	  <div class="text1"><strong><%=itemMap.get("cwfy").getText() %></strong></div>										
	  <div id="<%=itemMap.get("cwfy").getId() %>proIdspan" class="text1"><strong>20.7%</strong></div>										
	  <div id="<%=itemMap.get("cwfy").getId() %>proId" style="width:85px"></div>								
	 </div>	
	 <div class="content" style="margin-left:9px">										
	  <div class="text1"><strong><%=itemMap.get("yysj").getText() %></strong></div>										
	  <div id="<%=itemMap.get("yysj").getId() %>proIdspan" class="text1"><strong>20.7%</strong></div>										
	  <div id="<%=itemMap.get("yysj").getId() %>proId" style="width:85px"></div>								
	 </div>	
	 <div class="content" style="margin-left:9px">										
	  <div class="text1"><strong><%=itemMap.get("hbzj").getText() %></strong></div>										
	  <div id="<%=itemMap.get("hbzj").getId() %>proIdspan" class="text1"><strong>20.7%</strong></div>										
	  <div id="<%=itemMap.get("hbzj").getId() %>proId" style="width:85px"></div>								
	 </div>
	 <div class="content" style="margin-left:12px">										
	  <div class="text1"><strong><%=itemMap.get("yszk").getText() %></strong></div>										
	  <div id="<%=itemMap.get("yszk").getId() %>proIdspan" class="text1"><strong></strong></div>										
	  <div id="<%=itemMap.get("yszk").getId() %>proId" style="width:85px"></div>								
	 </div>							
	  <div class="content" style="margin-left:12px">										
	  <div class="text1"><strong><%=itemMap.get("ch").getText() %></strong></div>										
	  <div id="<%=itemMap.get("ch").getId() %>proIdspan" class="text1"><strong> </strong></div>										
	  <div id="<%=itemMap.get("ch").getId() %>proId" style="width:85px"></div>								
	 </div>						
	 <div class="content" style="margin-left:12px">										
	  <div class="text1"><strong><%=itemMap.get("qtysk").getText() %></strong></div>										
	  <div id="<%=itemMap.get("qtysk").getId() %>proIdspan" class="text1"><strong> </strong></div>										
	  <div id="<%=itemMap.get("qtysk").getId() %>proId" style="width:85px"></div>								
	 </div>
    </div>
  </div>	
  <div class="but">
    <div class="center-left">
     <div id="fs1"  class="but_left" style="margin-left:30px;">
	   <div><span style="font-family:微软雅黑;font-size: 13px;font-weight: bold!important;">成本费用构成</span></div>
	   <div class="sliderText" style="margin-top:7px;margin-left:-30px;"><%=itemMap.get("yycb").getText() %><input type="text" id="<%=itemMap.get("yycb").getId() %>Idinput" value="10000"></div>
	   <div id="<%=itemMap.get("yycb").getId() %>Id" style="margin-top:4px;margin-left:-30;width:150px"></div>		
	   <div class="sliderText" style="margin-left:-30px;"><%=itemMap.get("xsfy").getText() %><input type="text" id="<%=itemMap.get("xsfy").getId() %>Idinput" value="10000"></div>
	   <div id="<%=itemMap.get("xsfy").getId() %>Id" style="margin-top:4px;margin-left:-30;width:150px"></div>		
	   <div class="sliderText" style="margin-left:-30px;"><%=itemMap.get("glfy").getText() %><input type="text" id="<%=itemMap.get("glfy").getId() %>Idinput" value="10000"></div>
	   <div id="<%=itemMap.get("glfy").getId() %>Id" style="margin-top:4px;margin-left:-30;width:150px"></div>		
	   <div class="sliderText" style="margin-left:-30px;"><%=itemMap.get("cwfy").getText() %><input type="text" id="<%=itemMap.get("cwfy").getId() %>Idinput" value="10000"></div>
	   <div id="<%=itemMap.get("cwfy").getId() %>Id" style="margin-top:4px;margin-left:-30;width:150px"></div>		
	   <div class="sliderText" style="margin-left:-30px;"><%=itemMap.get("yysj").getText() %><input type="text" id="<%=itemMap.get("yysj").getId() %>Idinput" value="10000"></div>
	   <div id="<%=itemMap.get("yysj").getId() %>Id" style="margin-top:4px;margin-left:-30;width:150px"></div>					  
     </div>
	 <div id="fs2" class="but_left" style="margin-left:30px">
	   <div><span style="font-family:微软雅黑;font-size: 13px;font-weight: bold!important;">总资产构成</span></div>								
	   <div class="sliderText" style="margin-top:7px;margin-left:-30px;"><%=itemMap.get("hbzj").getText() %>&nbsp;&nbsp;&nbsp;<input type="text" id="<%=itemMap.get("hbzj").getId() %>Idinput" value="10000"></div>
	   <div id="<%=itemMap.get("hbzj").getId() %>Id" style="margin-top:4px;margin-left:-30;width:150px"></div>		
	   <div class="sliderText" style="margin-left:-30px;"><%=itemMap.get("yszk").getText() %>&nbsp;&nbsp;&nbsp;<input type="text" id="<%=itemMap.get("yszk").getId() %>Idinput" value="10000"></div>
	   <div id="<%=itemMap.get("yszk").getId() %>Id" style="margin-top:4px;margin-left:-30;width:150px"></div>		
	   <div class="sliderText" style="margin-left:-30px;"><%=itemMap.get("ch").getText() %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="<%=itemMap.get("ch").getId() %>Idinput" value="10000"></div>
	   <div id="<%=itemMap.get("ch").getId() %>Id" style="margin-top:4px;margin-left:-30;width:150px"></div>		
	   <div class="sliderText" style="margin-left:-30px;"><%=itemMap.get("qtysk").getText() %><input type="text" id="<%=itemMap.get("qtysk").getId() %>Idinput" value="10000"></div>
	   <div id="<%=itemMap.get("qtysk").getId() %>Id" style="margin-top:4px;margin-left:-30;width:150px"></div>		
	   <div class="sliderText" style="margin-left:-30px;"><%=itemMap.get("fldzc").getText() %><input type="text" id="<%=itemMap.get("fldzc").getId() %>Idinput" value="10000"></div>
	   <div id="<%=itemMap.get("fldzc").getId() %>Id" style="margin-top:4px;margin-left:-30;width:150px"></div>					  
     </div> 						
    </div>
  	<div class="center-right">
	 <div style="border:0px solid red;z-index:850;position: relative;font-size:14px;" class="sliderText"><center>同行业指标预警</center></div>	
	 <!-- <div style="border:0px solid red;width:50%;margin-top:-5px">			 -->		
	 <div class="sliderText" style="float:left;margin-left:70px;font-size:14px;"><center>净资产收益率</center></div>
	 <div class="sliderText" style="float:right;font-size:14px;margin-right:70px;"><center>总资产周转率</center></div>
	 <div style="clear:both;"></div>
	 <div id="jzcsylang" style="float:left;border:0px solid red;width:49%;height:210px;margin-left:-30px;margin-top:-3px;"></div>
	<!--  </div> -->
	<!--  <div style="border:0px solid red;width:50%;margin-left:50%;margin-top:-260px">	 -->					
	 <div id="zzczzlang" style="float:left;border:0px solid red;width:49%;height:210px;margin-left:-0px;margin-top:-3px;"></div>
	<!--  </div> -->
	   <!-- <div>5665</div> -->
	   <div style="clear:both;"></div>
	 <div style="margin-left:80px;margin-top:-10px;">
	     <table id="layer1" style=" width:300px;z-index:9999;position: absolute; text-align:center;">
	      <tr class="layerTh">
	         <th bgcolor="#FF0000" style="">差值</th>
	         <th bgcolor="#EEC900">平均值</th>
	         <th bgcolor="#00CD00">良好值</th>
	      </tr>
	   </table>
	 </div>
    </div>
  </div>
 </div>
 </div>
  <script type="text/javascript"src="js/industry.js"></script>
 <script type="text/javascript"src="js/dupont_gjx.js"></script>
  <script type="text/javascript">
	 Ext.onReady(function(){ 
		 var item='<%=item.toString()%>',
		 indi='<%=indicator.toString()%>';
		 var slider_array=item.split(",");//["yysr","yycb","yysjjfj","xsfy","glfy","cwfy","sds","hbzj","yszk","qtysk","ch","fldzc" ],
		 industryParams=[{"jzcsyv":"净资产收益率(%)"},{"zzczzv":"总资产周转率(次)"}],//str = Utils.getUtilBeanStr(industryParams) ,
		// index=slider_array.join()+",zczj,fzzj,dqtz,yspj,yfzk,ysgl,yslx,ynndqdfldzc,qtldzc,zczjN,fzzjN,zyywcb,qcsyzqyN,qcsyzqy,gyzbddsy,tzsy,yywsr,yywzc,zcjzss";
		  progress_array=["<%=itemMap.get("yysj").getId()%>pro",
		                  "<%=itemMap.get("xsfy").getId()%>pro","<%=itemMap.get("glfy").getId()%>pro",
						  "<%=itemMap.get("cwfy").getId()%>pro",
						  "<%=itemMap.get("yszk").getId()%>pro","<%=itemMap.get("qtysk").getId()%>pro",
						  "<%=itemMap.get("ch").getId()%>pro","<%=itemMap.get("fldzc").getId()%>pro",
						  "<%=itemMap.get("yycb").getId()%>pro","<%=itemMap.get("hbzj").getId()%>pro",
						  "<%=itemMap.get("ldzc").getId()%>","<%=inMap.get("cbfyze").getId()%>",
		                  "<%=itemMap.get("zzc").getId()%>","<%=itemMap.get("yysr").getId()%>pro1",
						  "<%=itemMap.get("yysr").getId()%>pro2","<%=inMap.get("shjlr").getId()%>",
						  "<%=inMap.get("zzczzv").getId()%>","<%=inMap.get("xslrv").getId()%>",
						  "<%=inMap.get("qycs").getId()%>","<%=inMap.get("zzcjlv").getId()%>",
						  "<%=inMap.get("jzcsyv").getId()%>"];
		 var params ={itemIndex:"<%=index%>",showDim:'item',povitDim:'item',queryFact:'B',company:company["id"],type:"dupont",year :qj.year,month :qj.month,unit :qj.unit};
		var dd = <%=zIndicator.toString()%>;
		//console.dir(dd);
		 var bean =  new Cnbi.model.Dupont({
			   id:'dupont',
		       slider_array:slider_array,
		       params:params,
		       progress_array:progress_array,
		       updateInput:'Idinput',
		       doubleUIFlag:"pro",
		       pro:{width:91,height:18},
		       sli:{width:140,width2:100},
		       domArray:["jzcsylang","zzczzlang","_cnbi_chartId"],
		       companyName:company["text"],
		       indi:indi,//从数据库找的公式ID群
		       zIndicator:dd,//自定义公式群 zcfzv
		       judgeObj:{zcfzv:"<%=inMap.get("zcfzv").getId()%>",qtysk:"<%=itemMap.get("qtysk").getId()%>",zzczzv:"<%=inMap.get("zzczzv").getId()%>",jzcsyv:"<%=inMap.get("jzcsyv").getId()%>",yysr:"<%=itemMap.get("yysr").getId()%>",sds:"<%=itemMap.get("sds").getId()%>",zzc:"<%=itemMap.get("zzc").getId()%>",indZzc:"<%=inMap.get("zzc").getId()%>",hbzj:"<%=itemMap.get("hbzj").getId()%>",yszk:"<%=itemMap.get("yszk").getId()%>",ch:"<%=itemMap.get("ch").getId()%>"}
		     
		       
		       
	 }); 
		// Ext.select("#doc").show();
	});
</script>
</body>
</html>
